#include <stdio.h>
#include <esp_log.h>
#include <multi_heap.h>
#include <esp_heap_caps.h>

void log_psram_info() {
    size_t psram_total = heap_caps_get_total_size(MALLOC_CAP_SPIRAM);
    size_t psram_free = heap_caps_get_free_size(MALLOC_CAP_SPIRAM);

    printf("PSRAM total size: %u bytes\n", psram_total);
    printf("PSRAM free size: %u bytes\n", psram_free);
}

void log_heap_info(){
    multi_heap_info_t heap_info;
    heap_caps_get_info(&heap_info, MALLOC_CAP_DEFAULT);
    ESP_LOGI("ESP", "Free heap: %d bytes\n", heap_info.total_free_bytes);
}